home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / MoreFiles 1.2.1 / Search.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-20  |  3.7 KB  |  128 lines  |  [TEXT/KAHL]

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    IndexedSearch and the PBCatSearch compatibility function.
  5. **
  6. **    by Jim Luther, Apple Developer Technical Support
  7. **
  8. **    File:        Search.h
  9. **
  10. **    Copyright © 1992-1994 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  17. **    after having made changes. If you're going to re-distribute the source,
  18. **    we require that you make it clear in the source that the code was
  19. **    descended from Apple Sample Code, but that you've made changes.
  20. */
  21.  
  22. #ifndef __SEARCH__
  23. #define __SEARCH__
  24.  
  25. #ifndef __CONDITIONALMACROS__
  26. #include <ConditionalMacros.h>
  27. #endif
  28.  
  29. #ifndef __TYPES__
  30. #include <Types.h>
  31. #endif
  32.  
  33. #ifndef __GESTALTEQU__
  34. #include <GestaltEqu.h>
  35. #endif
  36.  
  37. #ifndef __TIMER__
  38. #include <Timer.h>
  39. #endif
  40.  
  41. #ifndef __ERRORS__
  42. #include <Errors.h>
  43. #endif
  44.  
  45. #ifndef __MEMORY__
  46. #include <Memory.h>
  47. #endif
  48.  
  49. #ifndef __FILES__
  50. #include <Files.h>
  51. #endif
  52.  
  53. #ifndef __TEXTUTILS__
  54. #include <TextUtils.h>
  55. #endif
  56.  
  57. #ifndef __MOREFILES__
  58. #include "MoreFiles.h"
  59. #endif
  60.  
  61. #ifndef __MOREFILESEXTRAS__
  62. #include "MoreFilesExtras.h"
  63. #endif
  64.  
  65. /*****************************************************************************/
  66.  
  67. pascal    OSErr    IndexedSearch(CSParamPtr pb,
  68.                               long dirID);
  69. /*    ¶ Search in and below a directory.
  70.     The IndexedSearch function performs an indexed search in and below the
  71.     specified directory using the same parameters (in pb) as is passed to
  72.     PBCatSearch. See Inside Macintosh: Files for a description of the
  73.     parameter block.
  74.     
  75.     pb            input:    A CSParamPtr record specifying the volume to search
  76.                         and the search criteria.
  77.                 output:    Fields in the parameter block are returned indicating
  78.                         the number of matches found, the matches, and if the
  79.                         search ended with noErr, the CatPosition record that
  80.                         lets you resume a search where the last search left
  81.                         off.
  82.     dirID        input:    The directory to search. If fsRtDirID is passed,
  83.                         the entire volume is searched.
  84.     
  85.     Note:    If you use a high-level debugger and use ioSearchTime to limit
  86.             the length of time to run the search, you'll want to step over
  87.             calls to IndexedSearch because it installs a Time Manager task.
  88.             Most high-level debuggers don't deal gracefully with interrupt
  89.             driven code.
  90.     
  91.     __________
  92.     
  93.     See also:    PBCatSearch, PBCatSearchSyncCompat
  94. */
  95.  
  96. /*****************************************************************************/
  97.  
  98. pascal    OSErr    PBCatSearchSyncCompat(CSParamPtr paramBlock);
  99. /*    ¶ Search a volume using PBCatSearch or IndexedSearch.
  100.     The PBCatSearchSyncCompat function uses PBCatSearch (if available) or
  101.     IndexedSearch (if PBCatSearch is not available) to search a volume
  102.     using a set of search criteria that you specify. It builds a list of all
  103.     files or directories that meet your specifications.
  104.     
  105.     pb            input:    A CSParamPtr record specifying the volume to search
  106.                         and the search criteria.
  107.                 output:    Fields in the parameter block are returned indicating
  108.                         the number of matches found, the matches, and if the
  109.                         search ended with noErr, the CatPosition record that
  110.                         lets you resume a search where the last search left
  111.                         off.
  112.     
  113.     Note:    If you use a high-level debugger and use ioSearchTime to limit
  114.             the length of time to run the search, you'll want to step over
  115.             calls to PBCatSearchSyncCompat because it calls IndexedSearch
  116.             which installs a Time Manager task. Most high-level debuggers
  117.             don't deal gracefully with interrupt driven code.
  118.     
  119.     __________
  120.     
  121.     See also:    PBCatSearch, IndexedSearch
  122. */
  123.  
  124. /*****************************************************************************/
  125.  
  126. #endif
  127.  
  128.